import request from '@/utils/request'

// 1.获取 所有的组织架构数据
export const reqGetDepartments = () => {
  return request({
    method: 'get',
    url: '/company/department'
  })
}

// 2.根据id删除部门
export const reqDelDepartment = (id) => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}

// 3.新增部门
export const reqAddDepartment = (data) => {
  return request({
    method: 'post',
    url: '/company/department',
    data
  })
}

// 4.根据id获取部门详情
export const reqGetDepartDetail = (id) => {
  return request({
    method: 'get',
    url: `/company/department/${id}`
  })
}

// 5.修改部门信息
export const reqUpdateDepartments = (data) => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data
  })
}
